package other.example;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JList;
import javax.swing.JButton;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.AbstractListModel;

public class DataTableFrame extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					DataTableFrame frame = new DataTableFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public DataTableFrame() {
		setTitle("\u9009\u62E9\u6570\u636E\u8868");
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 309, 443);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JList dataTableList = new JList();
		dataTableList.setModel(new AbstractListModel() {
			String[] values = new String[] {"sysUser", "demo"};
			public int getSize() {
				return values.length;
			}
			public Object getElementAt(int index) {
				return values[index];
			}
		});
		dataTableList.setBounds(0, 0, 291, 326);
		contentPane.add(dataTableList);
		
		JButton okButton = new JButton("\u9009\u62E9");
		okButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		okButton.setBackground(Color.LIGHT_GRAY);
		okButton.setBounds(93, 352, 86, 44);
		contentPane.add(okButton);
		
		JButton cancleButton = new JButton("\u53D6\u6D88");
		cancleButton.setBackground(Color.LIGHT_GRAY);
		cancleButton.setBounds(193, 352, 86, 44);
		contentPane.add(cancleButton);
	}
}
